﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MarketOnlineBUS;
using MarketOnlineDTO;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            init();
        }
    }

    public void init()
    {
        GioHangBUS bus = new GioHangBUS();
        lbSoLuongGioHang.Text = bus.DemSoLuongSanPhamGioHang((List<GioHangDTO>)Session["Cart"]).ToString();
        lbTongGiaTri.Text = bus.TinhTongTienGioHang((List<GioHangDTO>)Session["Cart"]).ToString();
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Response.Redirect("Search");
    }
    
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        Session["key_search"] = txtTimKiem.Text;

        Response.Redirect("Search.aspx");
    }
}
